Skip to content

Fix( mqtt ) mqv filter operator precedence - #1511

Merged
relu91 merged 5 commits into
eclipse-thingweb:masterfrom
jona42-ui:fix/binding-mqtt-mqv-filter-operator-precedence
Oct 21, 2026
Merged

relu91 merged 5 commits into
eclipse-thingweb:masterfrom
jona42-ui:fix/binding-mqtt-mqv-filter-operator-precedence

Conversation

@jona42-ui

Copy link
Copy Markdown
Contributor

use the logical OR operator (||) instead of nullish coalescing (??)

Fixes #1508

@jona42-ui
jona42-ui force-pushed the fix/binding-mqtt-mqv-filter-operator-precedence branch from 7289e7f to b6a6b9e Compare March 29, 2026 12:19

@relu91 relu91 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! Changes look good. Do you mind adding two tests:

  1. Verify that the bug described in #1508 is solved
  2. Verify if the form has no path and no filter; the client throws an error.

I would add them both here. Thanks!

@danielpeintner

Copy link
Copy Markdown
Member

@jona42-ui do you still plan to work on some tests? Thank you!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@jona42-ui
jona42-ui force-pushed the fix/binding-mqtt-mqv-filter-operator-precedence branch from 5cca2c4 to aca20dd Compare October 21, 2026 06:47
jona42-ui and others added 5 commits October 21, 2026 09:52
…llback

The nullish coalescing operator (??) only triggers on null or undefined,
not on empty strings. When the URL path is '/', pathname.slice(1) returns
'' which is falsy but not null/undefined, causing mqv:filter and mqv:topic
to be silently ignored.

Fixes eclipse-thingweb#1508

Signed-off-by: jona42-ui <jonathanthembo123@gmail.com>
Verify that subscribeResource uses mqv:filter when the form href has no
path (eclipse-thingweb#1508), and that it rejects when neither a path nor mqv:filter is
provided.

Signed-off-by: jona42-ui <jonathanthembo123@gmail.com>
@relu91
relu91 force-pushed the fix/binding-mqtt-mqv-filter-operator-precedence branch from 5da0bb9 to a6ee53d Compare October 21, 2026 07:54
@relu91

relu91 commented Oct 21, 2026

Copy link
Copy Markdown
Member

Hi @jona42-ui bad luck that I had some unstage work done this weekend. I reverted your commit as I introduced a separate file to test the URI logic exactly. Thank you anyway for your time and your contribution to node-wot! Really appreciate it. @danielpeintner let me know if you are okay to merge it.

note: I reverted your commit so that it still visibile in the history, if some other maitainers prefer your version of the test we can drop my revert.

@jona42-ui

Copy link
Copy Markdown
Contributor Author

Hi @jona42-ui bad luck that I had some unstage work done this weekend. I reverted your commit as I introduced a separate file to test the URI logic exactly. Thank you anyway for your time and your contribution to node-wot! Really appreciate it. @danielpeintner let me know if you are okay to merge it.

note: I reverted your commit so that it still visibile in the history, if some other maitainers prefer your version of the test we can drop my revert.

aah no worries @relu91 . thank you for the good work welldone.
I am happy to continue my contributions.

@relu91
relu91 merged commit 2eb7540 into eclipse-thingweb:master Oct 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mqv:filter is silently ignored due to operator precedence bug

4 participants